package com.xiaoda.service.impl;

import com.xiaoda.dao.CollectDao;
import com.xiaoda.entity.Collect;
import com.xiaoda.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl implements CollectService {

    @Autowired
    CollectDao collectDao;

    @Override
    public List<Collect> findAll() {
        return collectDao.findAll();
    }

    @Override
    public Collect isCollected(String fromUid, int toAid) {
        return collectDao.isCollected(fromUid, toAid);
    }

    @Override
    public int addCollectArticle(String fromUid, int toAid) {
        return collectDao.addCollectArticle(fromUid, toAid);
    }

    @Override
    public int delCollectArticle(String fromUid, int toAid) {
        return collectDao.delCollectArticle(fromUid, toAid);
    }

    @Override
    public List<Collect> findAllByUid(String fromUid, int start, int end) {
        return collectDao.findAllByUid(fromUid, start, end);
    }

    @Override
    public int deleteByUid(String uid) {
        return collectDao.deleteByUid(uid);
    }

    @Override
    public int deleteByAid(int aid) {
        return collectDao.deleteByAid(aid);
    }

}
